import 'package:flutter/material.dart';
import 'package:flutter_base_widget/inherited/headinfo.dart';
import 'package:flutter_base_widget/list/list_page.dart';
import 'package:flutter_base_widget/theme/theme_notifier.dart';

import 'package:provider/provider.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider<ThemeChanger>(
      create: (context) => ThemeChanger(),
      child: MaterialAppWithTheme(),
    );
  }
}

class MaterialAppWithTheme extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    final theme = Provider.of<ThemeChanger>(context);

    return MaterialApp(
    title: 'Flutter Demo',
    theme: theme.getTheme(),
    home: HeadInfo(
      "Head_ZL",
      ListPage()
    ),
      );
  }
}

